var x = 1
var y = x
x++
/**
 * 
 */
//字符串，数字，布尔值 存储的是值
//对象存储的是指针也就是地址
var j = ['a','b']
var k = j
// j[0] = 'x'
var m = ['a','b']
//浅拷贝
var jCopy = j.slice()

var arr = ['a','b',[1,2]]
var arr1 = arr
var arr2 = arr.slice()
// arr[2][1] = 'hello world'
//通过json实现深拷贝
let arr3Str = JSON.stringify(arr)
let arr3DepCopy = JSON.parse(arr3Str)

function bar(x){
    x++
}
function foo(obj){
    obj.name = '张三'
}
let stu = {
    name:'刘磊'
}
let z = 1
bar(z)
foo(stu)